package com.linkit.main;

import android.app.Activity;
import android.support.v4.app.ActionBarDrawerToggle;
import android.support.v4.widget.DrawerLayout;
import android.view.View;
import android.widget.ImageView;

/**
 * ndluc : class điều khiển đóng mở menu
 * */
public class ActionDrawerToggle extends ActionBarDrawerToggle {

	private ImageView icon;
	public ActionDrawerToggle(Activity activity, DrawerLayout drawerLayout,
			int drawerImageRes, int openDrawerContentDescRes,
			int closeDrawerContentDescRes) {
		super(activity, drawerLayout, drawerImageRes, openDrawerContentDescRes,
				closeDrawerContentDescRes);
	}
	
	public void setIcon(ImageView icon){
		this.icon = icon;
	}

	@Override
	public void onDrawerClosed(View drawerView) {
		icon.setImageResource(R.drawable.header_menu);
	}

	@Override
	public void onDrawerOpened(View drawerView) {
		icon.setImageResource(R.drawable.header_menu_focused);
	}
}